package com.example.demo;

import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Arrays;
import java.util.List;

@RestController
public class demo1 {
    @RequestMapping("/hello")
    public String HI(){
        return "hello";
    }
    @RequestMapping("/r2")
    public String R2(@RequestPart("file") MultipartFile file){
        String name=file.getOriginalFilename();
        return "上传成功"+name;
    }
    @RequestMapping("/R3")
    public String r8(String[] array){
        return "接到参数, array:"+ Arrays.toString(array);
    }
    @RequestMapping("/R4")
    public String R4(@RequestParam(required = false) List<String> list){
        return "接到参数, list:"+ list;
    }
    @RequestMapping("/R5")
    public String r8(@RequestBody Student student){
        return "接到参数, student:"+ student.toString();
    }

}
